package day_04;

/**
 * @ClassName Test09
 * @Description TODO
 * @Author hp
 * @Date 2021/6/6 16:03
 * @Version 1.0
 **/
public class Test09 {
    public static void main(String[] args) {
        int[] socres = new int[]{ 5,4,6,8,9,0,1,2,7,3};
        int min = socres[0] , max= socres[0];
        int sum = 0;
        for (int i =0;i<socres.length;i++){
            if(max<socres[i]){
                max =socres[i];
            }
            if (min>socres[i]){
                min = socres[i];
            }
            sum+=socres[i];
        }

        double average = (double)(sum-max-min)/(socres.length-2);
        System.out.println("平均值为:"+average);

    }

}
